package com.ccom.gateway.handler;

import com.ccom.core.common.model.BaseMap;
import com.ccom.gateway.loader.DynamicRouteLoader;
import com.ccom.redis.listener.CcomRedisListerer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * redis中路由刷新监听
 */
@Slf4j
@Component
public class LoderRouderHandler implements CcomRedisListerer {

    @Resource
    private DynamicRouteLoader dynamicRouteLoader;

    @Override
    public void onMessage(BaseMap message) {
        dynamicRouteLoader.refresh();
    }

}